package handler.assetFormHandlers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import customGUI.selectors.ComboBoxAssetSelector;


import form.AssetForm.AssetForm;

public class AFComboBoxAssetSelectorListener implements ActionListener {

	private AssetForm assetForm;
	private ComboBoxAssetSelector assetSelector;
	
	public AFComboBoxAssetSelectorListener(AssetForm assetForm, ComboBoxAssetSelector assetSelector){
		this.assetForm = assetForm;
		this.assetSelector = assetSelector;
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0) {
		assetForm.clear();
		if(assetSelector.getSelectedID()!=-1)
			assetForm.populate(assetSelector.getSelectedID());
	}
}
